ifeq ($(CC), )
	CC := gcc
endif

ifeq ($(LD), )
	LD :=gcc
endif

ifeq ($(AR), )
	AR :=ar
endif

CCFLAGS +=-c -Wall -Warray-bounds -Wno-unused-result -fpermissive -fPIC -fdiagnostics-color=auto
LDFLAGS +=-rdynamic

INCLUDE = -Iinclude


all:
	-mkdir -p ./linux/obj
	-mkdir -p ./linux/bin
	$(CC) -c src/net.c $(CCFLAGS) $(INCLUDE) -o linux/obj/net.o
	$(AR) rc linux/bin/libsocket.a linux/obj/net.o
	$(CC) src/net.c $(CCFLAGS) $(INCLUDE) -shared -fPIC -o linux/bin/libsocket.so 

clean:
	rm -rf linux/*

	